package model;

import java.util.Arrays;

public class SimpleEnergyProfile {
	private int id;
	private String industry;
	private String usageType;
	private int areasqft;
	private int annualEnergy;	
	private String month;
	private String day;
	private double[] energyProfile;
	
	public String toString() {
		String energyProfileStr="";
		for (int i=0;i<24;i++)
				energyProfileStr = energyProfileStr.concat(String.valueOf(energyProfile[i])) +" ";
		return "Industry: "+getIndustry()+
		" UsageType: "+getUsageType()+
		" areasqft: "+getAreasqft()+
		" annualEnergy: "+getAnnualEnergy()+
		" month: "+getMonth()+
		" day: "+getDay()+
		"\n"+
		"energyProfile: "+energyProfileStr;
	}
	
	/**
	 * divide profile values by maximum
	 * 
   1. int[] nums={6,-1,-2,-3,0,1,2,3,4};  
   2. Arrays.sort(nums);  
   3. System.out.println("Minimum = " + nums[0]);  
   4. System.out.println("Maximum = " + nums[nums.length-1]);  
	 */
	public void normalizeData() {
		double[] daytemp = new double[24];
		for (int month=0; month<12; month++) {
			daytemp = Arrays.copyOf(energyProfile,24);
			Arrays.sort(daytemp);
			
			for (int i=0; i<24; i++) {
				energyProfile[i] = energyProfile[i]/daytemp[daytemp.length-1];
			}
		}
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getMonth() {
		return month;
	}
	public void setMonth(String month) {
		this.month = month;
	}
	public String getDay() {
		return day;
	}
	public void setDay(String day) {
		this.day = day;
	}	
	public String getUsageType() {
		return usageType;
	}

	public void setUsageType(String usageType) {
		this.usageType = usageType;
	}

	public String getIndustry() {
		return industry;
	}

	public void setIndustry(String industry) {
		this.industry = industry;
	}

	public int getAreasqft() {
		return areasqft;
	}

	public void setAreasqft(int areasqft) {
		this.areasqft = areasqft;
	}

	public int getAnnualEnergy() {
		return annualEnergy;
	}

	public void setAnnualEnergy(int annualEnergy) {
		this.annualEnergy = annualEnergy;
	}

	public double[] getEnergyProfile() {
		return energyProfile;
	}

	public void setEnergyProfile(double[] energyProfile) {
		this.energyProfile = energyProfile;
	}
}
